<%--
  Created by IntelliJ IDEA.
  User: lenovo
  Date: 2023-12-22
  Time: 11:24
  To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ page isELIgnored="false" %>
<!-- 设置页面为Chain -->
<html lang="ch">
<head>
  <title>信息通知</title>
  <!-- 设置地址栏主题背景颜色 -->
  <meta name="theme-color" content="#000000">
  <!-- 页面描述 -->
  <meta name="description" content="页面描述信息">
  <!-- 移动端显示 -->
  <meta name="viewport" content="width=device-width,initial-scale=1.0">
  <script src="${pageContext.request.contextPath}/other/component/jquery.min.js"></script>
  <script src="${pageContext.request.contextPath}/other/scripts/reception_desk/order.js"></script>
  <script src="${pageContext.request.contextPath}/other/request/background/gaud.js"></script>
  <script src="${pageContext.request.contextPath}/other/scripts/reception_desk/address_img.js"></script>
  <script src="${pageContext.request.contextPath}/other/resource/address_util.js"></script>
  <!-- 页面Logo -->
  <link rel="shortcut icon" href="http://localhost:8083/resource_packs/images/logo.png">
  <link href="${pageContext.request.contextPath}/other/style/reception_desk/order.css" rel="stylesheet"
        type="text/css"/>
</head>
<body>
<jsp:useBean id="id" scope="request" type="java.lang.Integer"/>
<div class="content" information-id="${id}" accountId="${accountId}" accountName="${name}" state="${state}">
  <div class="personal-information">
    <div class="uc-box uc-main-box">
      <div class="uc-content-box">
        <div class="box-hd">
          <h1 class="title">
            我的订单
            <small>请谨防钓鱼链接或诈骗电话，<a href="">请了解更多></a></small>
          </h1>
          <div class="more-order clearfix">
            <ul class="filter-list-order">
              <li class="first-active-order">
                <a class="valid-orders" href="javascript:void(0);">全部有效订单</a>
              </li>
              <li class>
                <a class="treat-paid" href="javascript:void(0);">待支付</a>
              </li>
              <li class>
                <a class="treat-receiving" href="javascript:void(0);">待收货</a>
              </li>
              <li class>
                <a class="expired-orders" href="javascript:void(0);">过期订单</a>
              </li>
            </ul>
            <div class="search">
              <div class="search-input">
                <label>
                  <input type="text" placeholder="输入商品名称、订单号">
                </label>
              </div>
              <div class="search-img" style="height: 40px">
                <img src="http://localhost:8083/resource_packs/images/search_%23fff.png" alt="搜索">
              </div>
            </div>
          </div>
        </div>
        <div class="box-bd">
          <div>
            <jsp:useBean id="orders" scope="request" type="java.util.List"/>
            <ul class="order-list">
              <li class="empty">当前没有交易订单。</li>
              <c:forEach var="item" items="${orders}" varStatus="orders">
                <li class="order-div">
                  <div class="order-top" index="${orders}">
                        <span class="order-status">
                          <c:if test="${item.ordersStatus == 0}">未付款</c:if>
                          <c:if test="${item.ordersStatus == 1}">未付尾款</c:if>
                          <c:if test="${item.ordersStatus == 2}">删除</c:if>
                          <c:if test="${item.ordersStatus == 3}">订单过期</c:if>
                          <c:if test="${item.ordersStatus == 4}">未发货</c:if>
                          <c:if test="${item.ordersStatus == 6}">运货中</c:if>
                          <c:if test="${item.ordersStatus == 7}">分拣中</c:if>
                          <c:if test="${item.ordersStatus == 8}">送货中</c:if>
                          <c:if test="${item.ordersStatus == 9}">已送达</c:if>
                        </span>
                    <span class="order-span-right" orders-id="${item.ordersId}" orders-index="${orders.index}">
                      <img class="order-img" src="http://localhost:8083/resource_packs/images/delete.png" alt="删除">
                    </span>
                  </div>
                  <div class="order-button">
                    <span class="order-button-span">
                      <span>${item.placeOrderDate}</span><span> | ${item.addressName} | </span><span>订单号：</span><span class="order-substance-ordersId">${item.ordersId}</span><span> | <c:if test="${item.paymentMethods == 0}">微信支付APP</c:if><c:if test="${item.paymentMethods == 1}">支付宝支付APP</c:if><c:if test="${item.paymentMethods == 2}">银行卡支付</c:if></span>
                    </span>
                    <span class="order-button-right">实付金额：<span class="order-button-price">${item.paymentPrice}</span> 元</span>
                  </div>
                  <div class="order-substance">
                      <c:forEach var="numberProducts" items="${item.numberProducts}" varStatus="numberProductsStatus">
                        <c:if test="${fn:replace((fn:length(item.numberProducts)+1)/2, '.0','' )>1}">
                          <c:forEach  var="commodityList" items="${item.commodityList}" begin="${fn:replace((numberProductsStatus.index+numberProducts)/numberProducts,'.0' ,'' )+1}" end="${fn:replace((numberProductsStatus.index+numberProducts)/numberProducts,'.0' ,'' )+1}">
                            <div class="order-substance-div">
                              <div>
                                <c:forEach var="commodityImages" items="${commodityList.commodityImages}">
                                  <img commodityId="${commodityList.commodityId}" class="order-substance-img" src="http://localhost:8083/resource_packs/images/${commodityImages} "alt="商品图片" width="110px">
                                </c:forEach>
                              </div>
                              <div class="order-substance-span">
                                <span>
                                ${commodityList.commodityName}
                              <c:forEach var="commoditySpecification" items="${commodityList.commoditySpecification}" begin="0" end="0">
                                ${commoditySpecification.specificationName}
                              </c:forEach>
                                  <br>
                                <c:forEach var="commodityInsurances" items="${commodityList.commodityInsurances}" begin="0" end="0">
                                  ${commodityInsurances.insuranceTitle}
                                </c:forEach>
                          [交易快照]
                            ${commodityList.commodityPrice}元
                              x ${numberProducts}
                            </span>
                              </div>
                              <div class="order-substance-set">
                                <c:if test="${item.ordersStatus == 9}">
                                  <div class="order-details" orders-id="${item.ordersId}">订单详情</div>
                                  <div class="contact-customer">联系客服</div>
                                  <div class="appraise-singles">评价晒单</div>
                                  <div class="apply-after-sales">申请售后</div>
                                </c:if>
                                <c:if test="${item.ordersStatus != 9}">
                                  <div class="order-details" orders-id="${item.ordersId}">订单详情</div>
                                  <div class="contact-customer">联系客服</div>
                                </c:if>
                              </div>
                            </div>
                          </c:forEach>
                        </c:if>
                        <c:if test="${fn:replace((fn:length(item.numberProducts)+1)/2, '.0','' )==1}">
                          <c:forEach  var="commodityList" items="${item.commodityList}" begin="${fn:replace((numberProductsStatus.index+numberProducts)/numberProducts,'.0' ,'' )-1}" end="${fn:replace((numberProductsStatus.index+numberProducts)/numberProducts,'.0' ,'' )-1}">
                            <div class="order-substance-div">
                              <div>
                               <c:forEach var="commodityImages" items="${commodityList.commodityImages}">
                                 <img commodityId="${commodityList.commodityId}" class="order-substance-img" src="http://localhost:8083/resource_packs/images/${commodityImages} "alt="商品图片" width="110px">
                               </c:forEach>
                             </div>
                              <div class="order-substance-span">
                                <span>
                                ${commodityList.commodityName}
                              <c:forEach var="commoditySpecification" items="${commodityList.commoditySpecification}" begin="0" end="0">
                                ${commoditySpecification.specificationName}
                              </c:forEach>
                                  <br>
                                <c:forEach var="commodityInsurances" items="${commodityList.commodityInsurances}" begin="0" end="0">
                                  ${commodityInsurances.insuranceTitle}
                                </c:forEach>
                          [交易快照]
                            ${commodityList.commodityPrice}元
                              x ${numberProducts}
                            </span>
                              </div>
                              <div class="order-substance-set">
                                <c:if test="${item.ordersStatus == 9}">
                                  <div class="order-details" orders-id="${item.ordersId}">订单详情</div>
                                  <div class="contact-customer">联系客服</div>
                                  <div class="appraise-singles">评价晒单</div>
                                  <div class="apply-after-sales">申请售后</div>
                                </c:if>
                                <c:if test="${item.ordersStatus != 9}">
                                  <div class="order-details" orders-id="${item.ordersId}">订单详情</div>
                                  <div class="contact-customer">联系客服</div>
                                </c:if>
                              </div>
                            </div>
                          </c:forEach>
                        </c:if>
                      </c:forEach>
                  </div>
                </li>
              </c:forEach>
            </ul>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
</body>
</html>
